<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title></title>
		 <link rel="stylesheet" href="css/amazeui.min.css" />
		  <link rel="stylesheet" href="css/admin.css" />
	</head>

    <script src="js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
       /* function tianjia(tid) {
            var stock=$("#tid").val();
            alert(tid)
           $.getJSON("/warehouse/insertGoods","goodsid="+tid+"&stock="+stock,xx);
           function xx(data) {
               alert(data)
               if (data=="添加成功"){
                   $("."+tid).hide();
               }else {
                   alert(data)
               }
           }
        }*/
    </script>
	<body>
		
		<div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf">
          <strong class="am-text-primary am-text-lg">产品管理</strong> 
        </div>
      </div>

            <div class="am-input-group am-input-group-sm">
                <input type="text" class="am-form-field">
                <span class="am-input-group-btn">
            <button class="am-btn am-btn-default" type="button">搜索</button>
          </span>
            </div>

      <hr>

      <ul class="am-avg-sm-2 am-avg-md-4 am-avg-lg-6 am-margin gallery-list">
        <li th:each="CommodityList : ${commodityList}" th:class="${CommodityList.getGoodsid()}">
          <a href="#">
            <img class="am-img-thumbnail am-img-bdrs" th:src="@{/image/{fileName}(fileName=(${CommodityList.getPicturepath()}))}" alt="" style="height: 5cm;width: 6cm">
              <div class="gallery-title" th:text="${CommodityList.getTradename()}"></div>
              <span th:text="${CommodityList.getPrice()}"></span>
              <form action="/insertGoods" method="get">
                  <input type="text"placeholder="库存" name="stock" pattern="^[1-9]\d*$" required>
                  <input type="hidden" th:value="${CommodityList.getGoodsid()}" name="goodsid">
                  <input type="submit"value="添加">
                  <!-- th:onclick="|javascript:tianjia(${CommodityList.getGoodsid()})|"-->
              </form>
          </a>
        </li>
      </ul>

    
    </div>
	</body>
</html>
